/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JAVIER
 */
@Entity
@Table(name = "bdagrupados.ofertas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ofertas.findAll", query = "SELECT o FROM Ofertas o"),
    @NamedQuery(name = "Ofertas.findByIdOferta", query = "SELECT o FROM Ofertas o WHERE o.idOferta = :idOferta"),
    @NamedQuery(name = "Ofertas.findByOfeNegocio", query = "SELECT o FROM Ofertas o WHERE o.ofeNegocio = :ofeNegocio"),
    @NamedQuery(name = "Ofertas.findByOfeFecalta", query = "SELECT o FROM Ofertas o WHERE o.ofeFecalta = :ofeFecalta"),
    @NamedQuery(name = "Ofertas.findByOfeFecfin", query = "SELECT o FROM Ofertas o WHERE o.ofeFecfin = :ofeFecfin"),
    @NamedQuery(name = "Ofertas.findByOfeTitulo", query = "SELECT o FROM Ofertas o WHERE o.ofeTitulo = :ofeTitulo"),
    @NamedQuery(name = "Ofertas.findByOfeDescripcion", query = "SELECT o FROM Ofertas o WHERE o.ofeDescripcion = :ofeDescripcion"),
    @NamedQuery(name = "Ofertas.findByOfePrecio", query = "SELECT o FROM Ofertas o WHERE o.ofePrecio = :ofePrecio"),
    @NamedQuery(name = "Ofertas.findByOfeAhorro", query = "SELECT o FROM Ofertas o WHERE o.ofeAhorro = :ofeAhorro"),
    @NamedQuery(name = "Ofertas.findByOfeMaxpordia", query = "SELECT o FROM Ofertas o WHERE o.ofeMaxpordia = :ofeMaxpordia"),
    @NamedQuery(name = "Ofertas.findByOfeTipo", query = "SELECT o FROM Ofertas o WHERE o.ofeTipo = :ofeTipo"),
    @NamedQuery(name = "Ofertas.findByOfePeriodovalidez", query = "SELECT o FROM Ofertas o WHERE o.ofePeriodovalidez = :ofePeriodovalidez")})
public class Ofertas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_oferta")
    private Integer idOferta;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ofe_negocio")
    private int ofeNegocio;
    @Column(name = "ofe_fecalta")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ofeFecalta;
    @Column(name = "ofe_fecfin")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ofeFecfin;
    @Size(max = 45)
    @Column(name = "ofe_titulo")
    private String ofeTitulo;
    @Size(max = 150)
    @Column(name = "ofe_descripcion")
    private String ofeDescripcion;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "ofe_precio")
    private Double ofePrecio;
    @Column(name = "ofe_ahorro")
    private Integer ofeAhorro;
    @Column(name = "ofe_maxpordia")
    private Integer ofeMaxpordia;
    @Size(max = 45)
    @Column(name = "ofe_tipo")
    private String ofeTipo;
    @Column(name = "ofe_periodovalidez")
    private Integer ofePeriodovalidez;

    public Ofertas() {
    }

    public Ofertas(Integer idOferta) {
        this.idOferta = idOferta;
    }

    public Ofertas(Integer idOferta, int ofeNegocio) {
        this.idOferta = idOferta;
        this.ofeNegocio = ofeNegocio;
    }

    public Integer getIdOferta() {
        return idOferta;
    }

    public void setIdOferta(Integer idOferta) {
        this.idOferta = idOferta;
    }

    public int getOfeNegocio() {
        return ofeNegocio;
    }

    public void setOfeNegocio(int ofeNegocio) {
        this.ofeNegocio = ofeNegocio;
    }

    public Date getOfeFecalta() {
        return ofeFecalta;
    }

    public void setOfeFecalta(Date ofeFecalta) {
        this.ofeFecalta = ofeFecalta;
    }

    public Date getOfeFecfin() {
        return ofeFecfin;
    }

    public void setOfeFecfin(Date ofeFecfin) {
        this.ofeFecfin = ofeFecfin;
    }

    public String getOfeTitulo() {
        return ofeTitulo;
    }

    public void setOfeTitulo(String ofeTitulo) {
        this.ofeTitulo = ofeTitulo;
    }

    public String getOfeDescripcion() {
        return ofeDescripcion;
    }

    public void setOfeDescripcion(String ofeDescripcion) {
        this.ofeDescripcion = ofeDescripcion;
    }

    public Double getOfePrecio() {
        return ofePrecio;
    }

    public void setOfePrecio(Double ofePrecio) {
        this.ofePrecio = ofePrecio;
    }

    public Integer getOfeAhorro() {
        return ofeAhorro;
    }

    public void setOfeAhorro(Integer ofeAhorro) {
        this.ofeAhorro = ofeAhorro;
    }

    public Integer getOfeMaxpordia() {
        return ofeMaxpordia;
    }

    public void setOfeMaxpordia(Integer ofeMaxpordia) {
        this.ofeMaxpordia = ofeMaxpordia;
    }

    public String getOfeTipo() {
        return ofeTipo;
    }

    public void setOfeTipo(String ofeTipo) {
        this.ofeTipo = ofeTipo;
    }

    public Integer getOfePeriodovalidez() {
        return ofePeriodovalidez;
    }

    public void setOfePeriodovalidez(Integer ofePeriodovalidez) {
        this.ofePeriodovalidez = ofePeriodovalidez;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOferta != null ? idOferta.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ofertas)) {
            return false;
        }
        Ofertas other = (Ofertas) object;
        if ((this.idOferta == null && other.idOferta != null) || (this.idOferta != null && !this.idOferta.equals(other.idOferta))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entidades.Ofertas[ idOferta=" + idOferta + " ]";
    }
    
}
